﻿using System;
using System.ServiceModel.Configuration;

namespace WcfCookieManager
{
	/// <summary>
	/// Provides properties that enable getting a new behavior extension based on configuration settings.
	/// </summary>
	/// <remarks>
	/// Please see the blog post titled "Managing shared cookies in WCF" by Enrico Campidoglio -http://megakemp.com/2009/02/06/managing-shared-cookies-in-wcf/ -
	/// for the description, original source code, and sample application.
	/// </remarks>
	public class CookieManagerBehaviorExtension : BehaviorExtensionElement
	{
		/// <summary>
		/// Gets the type of behavior.
		/// </summary>
		public override Type BehaviorType
		{
			get { return typeof(CookieManagerEndpointBehavior); }
		}

		/// <summary>
		/// Creates a behavior extension based on the current configuration settings.
		/// </summary>
		protected override object CreateBehavior()
		{
			return new CookieManagerEndpointBehavior();
		}
	}
}
